package com.dragon.repository.domain.dto;

import com.dragon.repository.entity.DeliverProducts;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.dragon.common.util.BeanUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Date;


/**
 * @author sy
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DeliverProductsDTO {

    private static final long serialVersionUID = 1L;

    private Integer id;

    @ApiModelProperty(value = "产品id")
    private Integer quotesProductId;

    @ApiModelProperty(value = "送货id")
    private Integer deliverId;

    @ApiModelProperty(value = "合同数量")
    private Integer num;

    @ApiModelProperty(value = "发货数量")
    private Integer deliverNum;

    @ApiModelProperty(value = "本次发货数量")
    private Integer oneNum;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "单位名称")
    private String unitName;

    @ApiModelProperty(value = "产品名称")
    private String name;

    @ApiModelProperty(value = "规格类型")
    private String specification;

    @ApiModelProperty(value = "产品备注")
    private String vProductRemark;

    @ApiModelProperty(value = "产品材质")
    private String vProductMaterial;


    public DeliverProductsDTO() {}

    public DeliverProductsDTO(DeliverProducts entity) {
        BeanUtils.copyProperties(entity,this);
    }

    public static DeliverProductsDTO convert(DeliverProducts entity) {
        return new DeliverProductsDTO(entity);
    }

    public static List<DeliverProductsDTO> convertList(List<DeliverProducts> list) {
        List<DeliverProductsDTO> resultList = new ArrayList<>();
        for (DeliverProducts entity : list) {
            resultList.add(new DeliverProductsDTO(entity));
        }
        return resultList;
    }}
